package expression;

import java.util.ArrayList;
import java.util.List;

import common.MCore;

public abstract class MBasicExpr extends MIntExpr {
	private List<MIntExpr> parameters;
	
	public List<MIntExpr> getParameters() {
		return parameters;
	}

	public MBasicExpr(MCore c) {
		super(c);
		parameters = new ArrayList<MIntExpr>();
	}
	
	public List<MIntVar> getVariables() {
		List<MIntVar> vars = new ArrayList<MIntVar>();
		
		for (MIntExpr i: getParameters()) {
			for (MIntVar v: i.getVariables()) {
				if (!vars.contains(v))
					vars.add(v);
			}
		}
		
		return vars;
	}
}
